package com.ybkj.daijia.server.controller;

import com.ybkj.daijia.common.Result;
import com.ybkj.daijia.server.service.impl.OcrServiceImpl;
import java.util.Map;
import org.apache.shiro.web.session.HttpServletSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("ocr")
public class OcrController {

    @Autowired
    private OcrServiceImpl ocrService;

    /*** 根据上传图片识别信息
     * @param base64 图片的base64编码
     * @param type 图片类型, 身份证正面:id;身份证反面:idb; 银行卡:bc, 驾驶证:dl, 机动车行驶证:v;网约车资格证:n
     * @param servletSession
     * @type interface
     * @struct json
     * @data :
     * {
     *     code:0,
     *     data:{
     *          type:传过来的类型,
     *          date:时间,
     *          kv:{
     *              //kv对
     *          }
     *     }
     * }
     * @remark 如果图片解析失败,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @return
     */
    @ResponseBody
    @RequestMapping(path = "recognition/{type}", method = RequestMethod.POST)
    public Result<Map<String, String>> recognitionImages(@RequestParam("base64") String base64, @PathVariable("type") String type, HttpServletSession servletSession){

        return null;
    }
}
